package xin.ganbo.entity;

import xin.ganbo.enums.LogTyep;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import java.util.Date;

/**
 * 系统日志
 * @author ganbo E-mail:bo.gan@56qq.com
 * @since 2017-12-02 15:15
 */
@Entity
@Table(name = "sys_log")
public class Log extends BaseEntity {

    private Long userId;            //操作用户id
    private String username;        //操作用户名
    private String methods;         //方法
    private String requestIp;       //用户ip
    private Long responseTime;      //操作系统响应时间
    private Date operTime;          //操作时间
    private String description;     //描述
    @Enumerated(EnumType.STRING)
    private LogTyep logTyep = LogTyep.BUSINESSLOG;    //日志类型(是普通日志还是异常日志,默认业务日志)
    private String exceptionMsg;                      //异常消息(这里暂时存储异常的类型)
    private String args;                              //传递参数

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMethods() {
        return methods;
    }

    public void setMethods(String methods) {
        this.methods = methods;
    }

    public String getRequestIp() {
        return requestIp;
    }

    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }

    public Long getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(Long responseTime) {
        this.responseTime = responseTime;
    }

    public Date getOperTime() {
        return operTime;
    }

    public void setOperTime(Date operTime) {
        this.operTime = operTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public LogTyep getLogTyep() {
        return logTyep;
    }

    public void setLogTyep(LogTyep logTyep) {
        this.logTyep = logTyep;
    }

    public String getExceptionMsg() {
        return exceptionMsg;
    }

    public void setExceptionMsg(String exceptionMsg) {
        this.exceptionMsg = exceptionMsg;
    }

    public String getArgs() {
        return args;
    }

    public void setArgs(String args) {
        this.args = args;
    }
}
